Image compression apparatus and image compression program

ABSTRACT

An image compression apparatus for compressing image data that includes luminance signal and chrominance signals includes an image judgement part that judges characterizing features of the image data on the basis of the luminance signal and/or chrominance signals, a subsampling rate setting part which sets the subsampling rate of the chrominance signals in accordance with the characterizing features thus judged, a subsampling processing part which performs subsampling processing of the image data at the set subsampling rate, and a compression encoding part which subjects the subsampling-processed image data to compression encoding.

This application claims the benefit of Japanese Patent ApplicationNo.2001-143675, filed in Japan on May 14, 2001, which is herebyincorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image compression apparatus thatcompresses color image data. The present invention further relates to animage compression program that is used to realize the above-mentionedimage compression apparatus in a computer.

2. Discussion of the Related Art

Conventionally, JPEG compression utilizing discrete cosinetransformations and JPEG 2000 compression utilizing discrete wavelettransformations, etc., have been well known as standards for thecompression of color image data.

In these compression standards, color image data is ordinarilytransformed from an RGB color space into a luminance/chrominance colorspace such as a YCbCr color space. Of these signals, the chrominancesignals are commonly subjected to subsampling processing (down-sampling)utilizing the human visual sensitivity characteristic that visualsensitivity with respect to chrominances is generally lower than visualsensitivity with respect to luminance.

FIGS. 8A through 8D are diagrams which show typical formats (4:4:4,4:2:2, 4:2:0, 4:1:1) for such subsampling processing. Conventionally, incases where irreversible compression is performed in an imagecompression apparatus mounted in an electronic camera, etch, the formatof the above-mentioned subsampling processing is fixed beforehand.Accordingly, in this type of image compression apparatus, even if thecompression parameters such as the target compression rate are altered,there is no alteration of the subsampling rate of the chrominancesignals.

Consequently, in the case of an image compression apparatus which isfixed at a coarse subsampling rate, image data that is rich in colorvariations cannot be adequately handled, which tends to cause problemssuch as a severe deterioration of color boundary information resultingin conspicuous jaggies, and a drop in the image S/N ratio at the time ofexpansion.

Furthermore, in the case of the 4:4:4 format in which the chrominancecomponent is not subsampled, the amount of code assigned to thechrominance signals is increased, so that the amount of code assigned tothe luminance signal is correspondingly decreased. As a result, in thecase of high compression, the amount of code assigned to the chrominancesignals overwhelms the amount of code assigned to the luminance signal,so that encoding distortion of the luminance signal tends to occur. Forexample, in the case of JPEG compression, the problem of block noisegeneration in the image occurs as a result of such encoding distortion.

SUMMARY OF THE INVENTION

Accordingly, the present invention is directed to image compressionapparatus and program that substantially obviate one or more of theproblems due to limitations and disadvantages of the related art.

An object of the present invention is to improve the quality ofcompressed images by appropriately varying the subsampling rate of thechrominance component.

Additional features and advantages of the invention will be set forth inthe description that follows, and in part will be apparent from thedescription, or may be learned by practice of the invention. Theobjectives and other advantages of the invention will be realized andattained by the structure particularly pointed out in the writtendescription and claims hereof as well as the appended drawings.

To achieve these and other advantages and in accordance with the purposeof the present invention, as embodied and broadly described, the presentinvention provides, in its first aspect, an image compression apparatusfor compressing image data that has a plurality of color componentsignals, including an image judgement part that judges characterizingfeatures of the image data, a subsampling rate setting part that setsthe subsampling rate of at least one of the color component signals inaccordance with the judged characterizing features, a subsamplingprocessing part that performs subsampling processing of the image dataat the set subsampling rate, and a compression encoding part whichsubjects the subsampling-processed image data to compression encoding.

In a second aspect, the image compression apparatus includes thefeatures of the first aspect, and additionally includes the featuresthat the image data has luminance signal and chrominance signals, theimage judgement part judges the characterizing features on the basis ofthe luminance signal and/or chrominance signals, and the subsamplingrate setting part sets the subsampling rate of the chrominance signalsin accordance with the judged characterizing features.

In a third aspect, the image compression apparatus includes the featuresof the second aspect and additionally includes the features that theimage judgement part judges the characterizing features from theproportion of the information in the image data that is accounted for bythe chrominance signals, and the subsampling rate setting part sets thesubsampling rate of the chrominance signals at a coarse value in caseswhere it is judged by the image judgement part that this proportion ofthe information is small, and sets the subsampling rate of thechrominance signals at a fine value in cases where it is judged by theimage judgement part that this proportion of the information is large.

In a fourth aspect, the image compression apparatus includes thefeatures of the second or third aspect, and further includes acompression rate setting part that sets the target compression rate ofthe image data, wherein the subsampling rate setting part sets thesubsampling rate of the chrominance signals in accordance with thecombined conditions of the characterizing features and the targetcompression rate.

In a fifth aspect, the present invention provides an image compressionapparatus for compressing image data that has a plurality of colorcomponent signals, including a compression rate setting part that sets atarget compression rate of the image data, a subsampling rate settingpart that sets the subsampling rate of at least one of the colorcomponent signals in accordance with the target compression rate, asubsampling processing part that performs subsampling processing of theimage data at the subsampling rate, and a compression encoding partwhich subjects the subsampling-processed image data to compressionencoding in accordance with the target compression rate.

In a sixth aspect, the present invention provides an image compressionapparatus for compressing image data that has a plurality of colorcomponent signals, including a distortion amount setting part that setsa target distortion amount of the image data, a subsampling rate settingpart that sets the subsampling rate of at least one of the colorcomponent signals in accordance with the target distortion amount, asubsampling processing part that performs subsampling processing of theimage data at the subsampling rate, and a compression encoding partwhich subjects the subsampling-processed image data to compressionencoding in accordance with the target distortion amount. In particular,this compression encoding part is equipped with an image transformationpart which subjects the image data to sub-band decomposition intofrequency regions, and produces transformation coefficients, aquantizing part that quantizes the transformation coefficients, and anencoding part that encodes the quantized transformation coefficients.

In a seventh aspect, the image compression apparatus includes thefeatures of the first, fifth, or sixth aspect, and additionally includesthe features that the image data has luminance signal and chrominancesignals, and the subsampling rate setting part sets the subsampling rateof the chrominance signals.

In an eighth aspect, the image compression apparatus includes thefeatures of the sixth aspect, and additionally includes the featuresthat the compression encoding part optimizes the quantization width sothat the encoding rate following quantization is minimized, under thefollowing constraining condition that the amount of code distortiongenerated in the quantization process of the compression encoding adopta value that corresponds to the target distortion amount.

In a ninth aspect, the image compression apparatus includes the featuresof any one of the first to eighth aspects, and additionally includes thefeatures that the compression encoding performed by the compressionencoding part is compression encoding that is performed in units of tileimages obtained by splitting the image data in the image space, thesubsampling rate setting part sets the subsampling rate separately foreach of the tile images, and the subsampling processing part subsamplesthe tile images at the subsampling rate set for each of the tile images.

In a tenth aspect, the image compression program includes a program codewhich is used to cause a computer to function as the image compressionapparatus having the features of any one of the first to ninth aspects.

In another aspect, the present invention provides an article ofmanufacture including a recording medium configured to be readable by acomputer; and software codes stored in the recording medium that can beread and interpreted by the computer so as to cause the computer tofunction as the image compression apparatus of any one of the first totenth aspects.

In another aspect, the present invention provides an article ofmanufacture including a recording medium configured to be readable by acomputer; and software codes stored in the recording medium that can beread and interpreted by the computer so as to cause the computer tofunction as the image compression apparatus of any one of the first totenth aspects, wherein the compression encoding performed by thecompression encoding part of the image compressing device is compressionencoding that is performed in units of tile images obtained by splittingthe image data in the image space, wherein the subsampling rate settingpart sets the subsampling rate separately for each of the tile images,and wherein the subsampling processing part subsamples the tile imagesat the subsampling rate set for each of the tile images.

In another aspect, the present invention provides a method forcompressing image data that has a plurality of color component signals,including judging characterizing features of the image data; setting asubsampling rate of at least one of the color component signals inaccordance with the characterizing features; performing subsamplingprocessing of the image data at the subsampling rate; and subjecting thesubsampling-processed image data to compression encoding.

In another aspect the present invention provides a method forcompressing image data that has a plurality of color component signals,including setting a target compression rate of the image data; setting asubsampling rate of at least one of the color component signals inaccordance with the target compression rate; performing subsamplingprocessing of the image data at the subsampling rate; and subjecting thesubsampling-processed image data to compression encoding in accordancewith the target compression rate.

In a further aspect, the present invention provides a method forcompressing image data that has a plurality of color component signals,including setting a target distortion amount of the image data; settinga subsampling rate of at least one of the color component signals inaccordance with the target distortion amount; performing subsamplingprocessing of the image data at the subsampling rate; and subjecting thesubsampling-processed image data to compression encoding in accordancewith the target distortion amount the compression encoding includingsubjecting the image data to sub-band decomposition into frequencyregions and producing transformation coefficients, quantizing thetransformation coefficients, and encoding the quantized transformationcoefficients.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory, andare intended to provide further explanation of the invention as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are included to provide a furtherunderstanding of the invention and are incorporated in and constitute apart of this specification, illustrate embodiments of the invention andtogether with the description serve to explain the principles of theinvention.

In the drawings:

FIG. 1 is a diagram which illustrates the construction of an electroniccamera 11 according to a first embodiment of the present invention;

FIG. 2 is a flow chart which illustrates the operation of the imagecompression processing according to the first embodiment;

FIG. 3 is a diagram which shows examples of subsampling rate settingtables;

FIG. 4 is a diagram which shows examples of subsampling rate settingtables;

FIG. 5 is a flow chart which illustrates the operation of the imagecompression processing in the second embodiment;

FIG. 6 is a diagram which illustrates the compressed data structure;

FIG. 7 is a flow chart which illustrates the operation of the imagecompression processing in the third embodiment; and

FIG. 8 is a diagram which shows examples of subsampling rate formats.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Reference will now be made in detail to the preferred embodiments of thepresent invention, examples of which are illustrated in the accompanyingdrawings.

First Embodiment

FIG. 1 is a diagram which shows the construction of an electronic camera11 according to a first embodiment of the present embodiment. As isshown in FIG. 1, a photographic lens 12 is mounted in the electroniccamera 11. An image-capturing sensor 13 is disposed at the image spaceof the photographic lens 12. The image data produced in thisimage-capturing sensor 13 is digitized via an A/D converter part 15, andis sent to a signal processing part 16. The signal processing part 16performs signal processing such as black level correction and gammacorrection on this image data. The image data that has been subjected tosignal processing is temporarily stored in a buffer memory 18 via a bus17.

An image processing part 19, an image compression part 20 and arecording part 21, etc., are connected to this bus 17. This imageprocessing part 19 performs image processing (color interpolation andcolor coordinate transformation, etc.) on the image data in the buffermemory 18. The image compression part 20 subjects the image data thathas thus been image-processed to compression encoding, thereby producinga compressed file. The recording part 21 records the resultantcompressed file on a memory card 22.

In addition, a microprocessor 23 used for system control, an externalinterface 27 used for data communications with an external computer 31,and an operating part 25 used to perform mode setting and releaseoperations, etc., are installed in the electronic camera 11. Thecompressed file is opened (expanded) by means of a computer, etc., andis output or displayed as a color image by means of a display orprinter, etc.

Various terminologies appeared throughout the instant application havethe following exemplary meanings with respect to the present embodiment.An image compression apparatus may be constructed of the imagecompression part 20 and microprocessor 23. An image judgement part maybe constructed of the portion of the microprocessor 23 that determinesclassification indices by comparing the amounts of information of thechrominance signals/luminance signal. Furthermore, a subsampling ratesetting part may be constructed of the portion of the microprocessor 23that sets the subsampling rate of the chrominance signals in accordancewith the combined conditions of the classification indices and thetarget compression rate. A subsampling processing part may beconstructed of the portion of the image compression part 20 thatperforms subsampling processing of the image data in accordance with theselected chrominance signal subsampling rate. A compression encodingpart may be constructed of the portion of the image compression part 20that performs JPEG or JPEG 2000 compression encoding. A compression ratesetting part may be constructed of the portion of the microprocessor 23that sets the target compression rate in response to an operationperformed by the user.

FIG. 2 is a flow chart which illustrates the operation of the imagecompression processing according to the first embodiment, In step S1,the microprocessor 23 acquires information from an internal memoryconcerning the target compression rate preset by the user, In step S2,the microprocessor 23 instructs the image processing part 19 regardingcolor coordinate transformation of the image data. The image processingpart 19 subjects the image data in the buffer memory 18 to a colorcoordinate transformation from an RGB color space to a YCbCr colorspace.

In stop S3, the microprocessor 23 successively reads out luminancesignal Y from the buffer memory 18, and determines the standarddeviation σ(Y) of the luminance signal Y in accordance with thefollowing equations:

$\begin{matrix}{{\text{<}Y\text{>} = \frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}{Y\left\lbrack {i,j} \right\rbrack}}}},} & (1) \\{{\sigma(Y)} = {\sqrt{\frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}\left( {{Y\left\lbrack {i,j} \right\rbrack} - {\text{<}Y\text{>}}} \right)^{2}}}}.}} & (2)\end{matrix}$

In the above equations, Y[i,j] indicates the luminance signal value (8bit gradation) at the pixel position [i,j], Nx is the number ofhorizontal pixels in the image data, and Ny is the number of verticalpixels in the image data.

In step S4, the microprocessor 23 successively reads out chrominancesignals CbCr from the buffer memory, and determines the standarddeviations σ(Cb) and σ(Cr) of the chrominance signals CbCr in accordancewith the following equations:

$\begin{matrix}{{\text{<}C\; b\text{>} = \frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}{C\;{b\left\lbrack {i,j} \right\rbrack}}}}},} & (3) \\{{{\sigma\left( {C\; b} \right)} = \sqrt{\frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}\left( {{C\;{b\left\lbrack {i,j} \right\rbrack}} - {\text{<}C\; b\text{>}}} \right)^{2}}}}},} & (4) \\{{\text{<}C\; r\text{>} = \frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}{C\;{r\left\lbrack {i,j} \right\rbrack}}}}},} & (5) \\{{\sigma\left( {C\; r} \right)} = {\sqrt{\frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}{\sum\limits_{j = 1}^{N\; y}\left( {{C\;{r\left\lbrack {i,j} \right\rbrack}} - {\text{<}C\; r\text{>}}} \right)^{2}}}}.}} & (6)\end{matrix}$

In the above equations, Cb[i,j] and Cr[i,j] are the chrominance signalvalues (8 bit gradation) at the pixel position [i,j].

In step S5, the microprocessor 23 compares the standard deviations σ(Cb)and σ(Cr) of the chrominance signals and the standard deviation σ(Y) ofthe luminance, and determines the proportion of the informationcontained in the image data that is accounted for by the chrominancesignals. More specifically, the determination is made by calculating oneof the following classification indices S1 through S3:

$\begin{matrix}{{{{Classification}\mspace{20mu}{Index}\mspace{20mu}{S1}} = \frac{\sigma(Y)}{{\sigma(Y)} + {\sigma\left( {C\; b} \right)} + {\sigma\left( {C\; r} \right)}}},} & (7) \\{{{{Classification}\mspace{20mu}{Index}\mspace{20mu}{S2}} = \frac{{\sigma(Y)}^{2}}{{\sigma(Y)}^{2} + {\sigma\left( {C\; b} \right)}^{2} + {\sigma\left( {C\; r} \right)}^{2}}},} & (8) \\{{{Classification}\mspace{20mu}{Index}\mspace{20mu}{S3}} = {\frac{\sigma(Y)}{{\sigma\left( {C\; b} \right)} + {\sigma\left( {C\; r} \right)}}.}} & (9)\end{matrix}$

In the case of these classification indices S1 through S3, a smallervalue indicates a greater proportion of the information contained in theimage data that is accounted for by the chrominance signals.

Furthermore, in calculating the classification indices S1 through S3,the standard deviation σ may be replaced by the dispersion or the sum σ*of the absolute values of the differences indicated by the followingequation:

$\begin{matrix}{{\sigma^{*}(X)} = \left. {\frac{1}{N\; x\; N\; y}{\sum\limits_{i = 1}^{N\; x}\sum\limits_{j = 1}^{N\; y}}} \middle| {{X\left\lbrack {i,j} \right\rbrack} - {\text{<}X\text{>}}} \middle| {.\left( {{{w\; h\; e\; r\; e\mspace{20mu} X} = Y},{C\; b},{C\; r}} \right)} \right.} & (10)\end{matrix}$

In step S6, the microprocessor 23 refers to a setting table anddetermines the subsampling rate of the chrominance signals on the basisof the combined conditions of the proportion of the information(classification index) determined in step S5 and the target compressionrate acquired as information in step S1. FIGS. 3A through 3C showexamples of setting tables used in the case of JPEG compression, whileFIG. 4A through 4C show examples of setting tables used in the case ofJPEG 2000 compression.

Here, in the case of a target compression rate at which the encodingdistortion of the luminance signal is large (e.g., 1 bpp in the case ofJPEG, or 0.5 bpp in the case of JPEG 2000), the subsampling rate is setat a coarse subsampling rate such as 4:2:0. As a result, the encodingdistortion of the luminance signal can be alleviated. Meanwhile, in thecase of a target compression rate at which the encoding distortion ofthe luminance signal is small (e.g., 4 bpp in the case of JPEG, or 4 bppin the case of JPEG 2000), the subsampling rate is set at a finesubsampling rate such as 4:4:4. As a result, the reproducibility ofcolor boundaries can be appropriately increased without inducingencoding distortion of the luminance signal.

Furthermore, in the case of a target compression rate at which theencoding distortion of the luminance signal is moderate (e.g., 2 bpp inthe case of JPEG, or 1 to 2 bpp in the case of JPEG 2000), thesubsampling rate is set on the basis of the classification index.Specifically, in cases where the classification index is less than acertain threshold value, the microprocessor 23 judges the image data tobe data that is rich in color variation, and sets the subsampling rateat a fine rate such as 4:4:4. Conversely, in cases where theclassification index exceeds this threshold value, the microprocessor 23judges the image data to be data that has little color variation, andsets the subsampling rate at a coarse rate such as 4.2:0.

In step S7, if the subsampling rate determined in step S6 is “4:4:4,”the microprocessor 23 advances the operation to step 38. On the otherhand, if the subsampling rate is “4:2:0,” the microprocessor 23 advancesthe operation to step S9. In step S8, the microprocessor 23 performsprocessing setting of a subsampling format of “4:4:4” for the imagecompression part 20. Following this processing, the microprocessor 23advances the operation to step S10. In step S9, the microprocessor 23performs processing setting of a subsampling format of “4:2:0” for theimage compression part 20. In accordance with this processing setting,the image compression part 20 performs chrominance subsampling of“4:2:0” on the image data in the buffer memory 18.

In step S10, the image compression part 20 performs compressionprocessing according to JPEG or JPEG 2000, for example, on the imagedata in the buffer memory 18, and thus produces a compressed file withthe target compression rate. In step S11, the image compression part 20adds header information relating to the subsampling rate to thecompressed file. This completes image compression processing of thisexample.

In the first embodiment the proportion of the information contained inthe image data that is accounted for by the chrominance signals isjudged on the basis of a comparison of the amounts of information of theluminance signal/chrominance signals (here, a comparison of the standarddeviations). In this case, if it is judged that the proportion of theinformation accounted for by the chrominance signals is relativelylarge, the subsampling rate for the chrominance signals is set at the4:4:4 format. Accordingly, in the case of image data with a relativelyrich color variation, problems such as drop-out and jaggies thataccompany chrominance subsampling can be avoided.

On the other hand, if it is judged that the proportion of chrominanceinformation in the overall image information is relatively small, thesubsampling rate for the chrominance signals is set at the 4:2:0 format.Accordingly, in the case of image data with relatively little colorvariation, the number of pixels in the chrominance signals isappropriately reduced, so that the assignment of code to the luminancesignal can be correspondingly increased. As a result, distortion of theluminance signal can be appropriately reduced, so that block noise inJPEG compression, etc., can be ameliorated.

Furthermore, in the first embodiment, a coarser subsampling rate isselected as the subsampling rate for the chrominance signals when thetarget compression rate is set at a higher compression. Accordingly, anincrease in the encoding distortion of the luminance signal can bepredicted from the target compression rate, and the subsampling rate ofthe chrominance signals can be altered to a coarse subsampling rate. Inthis case, the encoding distortion of the luminance signal can beameliorated, so that the overall compressed image quality can beimproved.

Second Embodiment

FIG. 5 is a flow chart which illustrates the operation of imagecompression processing according to a second embodiment. This imagecompression processing may be implemented in an apparatus similar to thefirst embodiment above—i.e., the apparatus depicted in FIG. 1, forexample. One of the characteristic features of this embodiment is thatthe subsampling rate is set for individual tile images. Portions of thisembodiment that correspond to this characteristic features will bedescribed in detail below. The other parts are constructed in a mannersimilar to those of the first embodiment.

(1) The microprocessor 23 divides the image data in the image space andsplits the image data into a plurality of tile images (step S30).

(2) For each of the individual tile images, the microprocessor 23determines the proportion of the information contained in the tile imagethat is accounted for by the chrominance signals (steps S34 throughS36).

(3) For each of the individual tile images, the microprocessor 23 variesthe subsampling rate in accordance with the combined conditions of theproportion of information and target compression rate (step S37).

(4) The image compression part 20 subjects the individual tile images tosubsampling processing at the respective subsampling rates (steps S39through S40).

(5) The image compression part 20 adds tile image subsampling rateinformation to the individual tile headers as shown in FIG. 6 (stepS42).

Effects similar to those of the first embodiment can be obtained by theprocessing including these features. In addition, in the secondembodiment, the subsampling rate of the chrominance signals can befinely adjusted and set in accordance with local special characteristicsof the individual tile images. Accordingly, the subsampling rate can befinely adjusted and altered in tile units in accordance with imagepatterns in the frame.

Third Embodiment

FIG. 7 is a flow chart which illustrates the operation of the imagecompression processing according to a third embodiment of the presentinvention. In step S71, the microprocessor 23 acquires informationconcerning a target distortion amount preset by the user from aninternal memory. This target distortion amount is given in terms of thedB value of the PSNR (peak signal to noise ratio). In step S72, themicroprocessor 23 instructs the image processing part 19 to perform acolor coordinate transformation of the image data. The image processingpart 19 subjects the image data in the buffer memory 18 to a colorcoordinate transformation from an RGB color space to a YCbCr colorspace.

In step S73, the microprocessor 23 performs a threshold value judgementon the target distortion amount. In this case, if the target distortionamount is equal to or greater than the threshold value (e.g.,corresponding to PSNR=32 dB), the microprocessor 23 judges that highimage quality compression processing is required, and advances theoperation to step S74. On the other hand, if the target distortionamount is less than the threshold value (e.g., corresponding to PSNR=32dB), the microprocessor 23 judges that ordinary image qualitycompression processing is required, and advances the operation to stepS75.

In step S74, the microprocessor 23 performs processing setting of asubsampling format of “4:4:4” for the image compression part 20.Following this processing, the microprocessor 23 advances the operationto step S76. In stop S75, the microprocessor 23 performs processingsetting of a subsampling format of “4:2:0” for the image compressionpart 20. In accordance with this processing setting, the imagecompression part 20 performs chrominance subsampling of “4:2:0” on theimage data in the buffer memory 18.

In step S76, the image compression part 20 recursively performs discretewavelet transformations for the image data in the buffer memory 18, andthus splits the image data into a plurality of sub-bands. In step S77,for each sub-band, the image compression part 20 prepares a frequencydistribution of the transformation coefficients x, and approximates theprobability density function of this distribution using the followingLaplace distribution equation:

$\begin{matrix}{{f(x)} = {\frac{\alpha}{2}{{\mathbb{e}}^{{- \alpha}|x|}.}}} & (11)\end{matrix}$

In step S78, the image compression part 20 acquires informationregarding the target distortion amount from the microprocessor 23. Sincethis target distortion amount is a distortion amount that uses pixelvalues as a reference, the image compression part 20 refers to aspecified conversion table and performs a conversion into a targetdistortion amount D_(o) in the frequency space. Furthermore, thisconversion table is a data table in which distortion amounts using apixel value as a reference and distortion amounts using transformationcoefficients as a reference are associated to each other based onmeasured values, etc.

In step S79, under the condition that the encoding distortion amount atthe time of quantization is constrained to the target distortion amount,the image compression part 20 optimizes the quantization width for eachsub-band so that the encoding rate is minimized.

This optimization problem will be described in principle as follows. Ifthe transformation coefficients x are uniformly quantized using aquantization step width of Δ, then the probability P_(k) that a giventransformation coefficient will assume the kth quantized value followingquantization is expressed as follows:

$\begin{matrix}{P_{k} = {\int_{\Delta{({k - {1/2}})}}^{\Delta{({k + {1/2}})}}{{f(x)}{{\mathbb{d}x}.}}}} & (12)\end{matrix}$

The encoding rate R(Δ) of the transformation coefficients based on thisquantization is ideally equal to the entropy, and is given by thefollowing equation:

$\begin{matrix}{{R(\Delta)} = {{- {\sum\limits_{k}{P_{k}\log\; P_{k}}}} = {{- {\log\left( {1 - {\mathbb{e}}^{{- {\alpha\Delta}}/2}} \right)}} + {{\mathbb{e}}^{{- {\alpha\Delta}}/2}\log\frac{2}{1 + {\mathbb{e}}^{{\alpha\Delta}/2}}} + {\frac{\alpha\Delta}{2\sinh\frac{\alpha\Delta}{2}}.}}}} & (13)\end{matrix}$

Furthermore, the distortion amount D(Δ) of the transformationcoefficients caused by this quantization can be expressed by thefollowing equation that evaluates the squared error:

$\begin{matrix}{{D(\Delta)} = {{\sum\limits_{k}{\int_{\Delta{({k - {1/2}})}}^{\Delta{({k + {1/2}})}}{\left( {x - {k\;\Delta}} \right)^{2}{f(x)}{\mathbb{d}x}}}} = {\frac{2}{\alpha^{2}} + {\frac{\Delta}{\alpha}{\mathbb{e}}^{{\alpha\Delta}/2}} + {\frac{2{\Delta cosh}\frac{\alpha\Delta}{2}}{\alpha\left( {1 - {\mathbb{e}}^{- {\alpha\Delta}}} \right)}.}}}} & (14)\end{matrix}$

In order to solve the above-identified optimization problem, aLagrangian (undetermined) multiplier λ is introduced, so that a functionJ is defined as follows:

$\begin{matrix}{J = {{\sum\limits_{i}{R_{i}\left( \Delta_{i} \right)}} + {{\lambda\left( {{\sum\limits_{i}{D_{i}\left( \Delta_{i} \right)}} - D_{o}} \right)}.}}} & (15)\end{matrix}$

Furthermore, in the above equation, sequence numbers, i=1, 2 . . . NA,are assigned to the individual sub-bands without distinguishing YCbCr.When this function J is subjected to a partial differentiation by thedistortion amount D_(i) of the sub-band i so that the optimal conditionsare determined, the following equation is obtained:

$\begin{matrix}{\frac{\partial J}{\partial D_{i}} = {{\frac{\mathbb{d}R_{i}}{\mathbb{d}D_{i}} + \lambda} = 0.}} & (16)\end{matrix}$

Equation (16) is transformed into:

$\begin{matrix}{\lambda = {{- \frac{\mathbb{d}R_{i}}{\mathbb{d}D_{i}}} = {{- \frac{\mathbb{d}R_{i}}{\mathbb{d}\Delta_{i}}}/{\frac{\mathbb{d}D_{i}}{\mathbb{d}\Delta_{i}}.}}}} & (17)\end{matrix}$

The right side of Equation (17) is expressed as a function of thequantization step width Δ_(i) alone. Accordingly, by determining theinverse function of Equation (17), it is possible to express thequantization step width Δ_(i) as a function of the undeterminedmultiplier λ:Δ_(i)=Δ_(i)(λ), where i=1, 2 . . . NA.  (18)

The distortion amount D_(i) of the sub-band i can be expressed as afunction of the undetermined multiplier λ by respectively substitutingthese equations into the following Equation (14):D _(i) =D _(i)(λ), where i=1, 2 . . . NA.  (19)

Then, the following evaluating calculation is performed after anappropriate λ is set so that D_(i)(λ) is determined:

$\begin{matrix}{D_{\lambda} = {\sum\limits_{i}{{D_{i}(\lambda)}.}}} & (20)\end{matrix}$

The adjustment of λ is repeated until this overall sum D_(λ) of thedistortion amounts substantially coincides with the target distortionamount D_(o) determined in step S78. Following this repetition, thequantization step width Δ_(i) (=1, 2 . . . NA) for each sub-band isdetermined by substituting the established λ into the above-mentionedequation of Δ_(i).

In step S80, the image compression part 20 performs quantization of thetransformation coefficients in accordance with the quantization stepwidth optimized for each sub-band. In step S81, the image compressionpart 20 subjects the quantized transformation coefficients to entropyencoding in bit plane units. In step S82, the image compression part 20subjects the entropy-encoded data to arithmetical encoding. In step S83:The image compression part 20 rearranges the encoded data into aspecified order, and thus produces a bit stream. In step S84, the imagecompression part 20 adds information regarding the subsampling rate ofthe chrominance signals to the bit stream as header information, therebyproducing a compressed file. This completes the processing of thisexample.

In the third embodiment, the subsampling rate of the chrominance signalsis altered in accordance with the target distortion amount. By suchadjustment of the subsampling rate of the chrominance signals using thetarget distortion amount as a reference material for judgement, it ispossible to optimize the information allocation of the luminancesignal/chrominance signals during image compression.

Furthermore, in the third embodiment, image compression processing mayalso be performed for each tile image. In this case, the quantizationstep width can be optimized by an even finer distinction for each tileimage. As a result, the quantization step width can be set individuallywith consideration of local differences in each tile image, so that moreappropriate image compression processing can be realized.

In the first and second embodiments described above, the proportion ofthe information contained in the image that is accounted for by thechrominance signals is judged as a characterizing feature(characteristic) of the image data. However, characterizing features ofthe image data are not limited to this. For example, the amount ofinformation in the chrominance signals alone, the amount of informationin the luminance signal alone, the space frequency distribution or ahistogram of the pixel values, etc., may also be used as thecharacterizing features of the image data.

Furthermore, besides using characterizing features of the image data, itis also be possible to alter the subsampling rate of the chrominancesignals in accordance with the image-capturing conditions of theelectronic camera 11. For example, at least one of the followingconditions (1) through (15) is usable as such imaging conditions:

-   (1) Lens stop value;-   (2) Focal length of photographic lens 12;-   (3) Individual characteristic information regarding the photographic    lens 12;-   (4) Sensitivity setting of the image-capturing sensor 13;-   (5) White balance adjustment value;-   (6) Gamma correction value;-   (7) Multi-pattern light measurement value;-   (8) Device temperature of image-capturing sensor 13;-   (9) Exposure time of image-capturing sensor 13;-   (10) Presence or absence of strobe use;-   (11) Magnification of electronic zoom;-   (12) Distance to object of imaging;-   (13) Focusing conditions of photographic lens 12;-   (14) Multi-point focusing conditions of photographic lens 12; and-   (15) Vertical position imaging or horizontal position imaging.

Furthermore, in the above-mentioned embodiments, image processingperformed in the electronic camera 11 was described. However, thepresent invention is not limited to such image processing. For example,the above-mentioned processing operations (e.g., FIG. 2, FIG. 5 or FIG.7) may be converted into a program code, thus creating an imagecompression program corresponding to the tenth aspect of the presentinvention above. The above-mentioned image compression apparatus can berealized by executing this image compression program in a computer.

Furthermore, in the above-mentioned embodiments, cases were described inwhich processing was performed in accordance with the JPEG or JPEG 2000compression standards, However, the present invention is not limited tothese standards. The present invention can be applied to all imagecompression in which subsampling processing of the color componentsignals (especially chrominance signals) is performed.

Furthermore, in regard to the tile images of the present invention, thepresent invention is not limited to the content stipulated in JPEG 2000.In general, the term “tile images” refers to small images obtained bysplitting the image data into a plurality of images in the image space.For example, such tile images are not limited to a rectangular shape,etc.

Furthermore, in the above-mentioned embodiments, subsampling ratesetting tables of FIG. 3 are used for illustrative purposes. However,the present invention is not limited to such setting tables. Forexample, the 4:2:2 format and 4:1:1 format, etc., may be provided asoptions for the subsampling rate. Especially in the case ofhigh-resolution image data, the pixel blocks that are referred to can beincreased in size; accordingly, various other formats can be usedbesides the subsampling formats shown in FIG. 8.

Furthermore, in the above-mentioned embodiments, the subsampling ratewas altered in two stages (i.e., the two options of 4.4:4 or 4:2:0).However, the present invention is not limited to such alteration. Thesubsampling rate may also be altered using a fine distinction consistingof three or more stages.

Furthermore, in the present invention, there are no particularlimitations on the content of the calculations performed in subsamplingprocessing. For example, various other subsampling processingcalculations, such as average calculations, median calculations andsimple pixel subsampling, may be used.

Furthermore, in the above-mentioned embodiments, compression processingin a YCbCr color space is described. However, the present invention isnot limited to such processing. For example, the present invention canalso be applied to a GCbCr color space, YUV color space, YIQ colorspace, G (R-G) (B-G) color space or Lab color space, etc.

Specifically, the term “chrominance signals” used here should beunderstood to be a generic term for color components that differ fromluminance signal (e.g., G component, Y component, L component, etc.) inthese various types of color spaces.

Furthermore, in the above-mentioned first and second embodiments,classification indices S1 through S3 using pixel values in the imagespace as a reference are determined as indices indicating the proportionof the information accounted for by the chrominance signals. However,the present invention is not limited to such indices, For example, theproportion of the information accounted for by the chrominance signalsmay also be determined in the frequency space.

According to the first aspect of the present invention, the subsamplingrate of the image signal is altered on the basis of characterizingfeatures of the image signal. By means of such alteration of thesubsampling rate, it is possible to adjust the distribution ofinformation in the compressed file in accordance with characterizingfeatures of the image data, so that the compressed image quality can beimproved.

According to the second aspect of the present invention, characterizingfeatures of the image are judged on the basis of the luminance signaland/or chrominance signals, and the subsampling rate of the chrominancesignals is altered in accordance with these characterizing features. Bymeans of such alteration of the subsampling rate, it is possible toadjust the distribution of the amounts of information of the luminancesignal/chrominance signals in the compressed file in accordance with theimage data. As a result, in the present invention, a distribution ofinformation that is suited to the image data can be achieved, so thatthe compressed image quality can be improved.

According to the third aspect of the present invention, the proportionof the information contained in the image data that is accounted for bythe chrominance signals is used as the characterizing feature of theimage data.

In cases where this proportion of the information that is accounted forby the chrominance signals is large, the image data is image data thathas a relatively rich color variation, and it may be predicted that thedeterioration in information caused by chrominance subsampling will belarge. Accordingly, by setting the subsampling rate at a finesubsampling rate in accordance with the judgement that this proportionof the information is large, the compressed image quality of image datathat is rich in color variation can be appropriately improved.

On the other hand, in cases where the proportion of the information thatis accounted for by the chrominance signals is small, the image data isimage data that has little color variations and it may be predicted thatthe deterioration in information caused by chrominance subsampling willbe relatively small. Accordingly, by setting the subsampling rate at acoarse subsampling rate in accordance with the judgement that thisproportion of the information is small, the number of pixels of thechrominance signals can be appropriately reduced at a level that has nogreat effect on the image quality. As a result, the assignment of codeto the luminance signal can be appropriately increased, so thatdistortion of the luminance signal can be suppressed. (In particular, aconsiderable reduction in block noise is achieved in the case of JPEGcompression).

According to the fourth aspect of the present invention, the subsamplingrate of the chrominance signals is set in accordance with the combinedconditions of the characterizing features of the image and the targetcompression rate. Generally, the amount of compression code that shouldbe preferably distributed between the luminance signal and thechrominance signal throughout the image data as a whole is approximatelydetermined by the target compression rate. Accordingly, the extent ofthe margin that is available in the information distribution of theimage data can be judged on the basis of the target compression rate.Consequently, by using the combined conditions of the characterizingfeatures of the image and target compression rate as judgement referencematerials, it is possible to make an accurate prediction of theconditions of information distribution at the time of image compression,so that a much more appropriate subsampling rate can be set.

According to the filth aspect of the present invention, the subsamplingrate of the image signal is altered on the basis of the targetcompression rate, Generally, the amount of compression code that shouldbe distributed throughout the image data as a whole is approximatelydetermined by the target compression rate. Accordingly, the extent ofthe margin that is available in the information distribution of theimage data can be predicted by means of the target compression rate.Consequently, by altering the subsampling rate in accordance with thetarget compression rate, it is possible to optimize the distribution ofinformation in the compressed file. As a result, the compressed imagequality can be improved.

According to the sixth aspect of the present invention, the subsamplingrate of the chrominance signals is set in accordance with the targetdistortion amount. This target distortion amount indicates the extent towhich small-level signals of the image are faithfully compressed andstored. Specifically, this target distortion amount is a measure thatinfluences the compressed image quality from a different angle than thetarget compression rate, Accordingly, by altering the subsampling ratein linkage with this target distortion amount, it is possible to controlthe overall compressed image quality more freely. As a result, effectiveimprovement of the overall compressed image quality is facilitated.Furthermore, in the case of such alteration of the subsampling rate, thedeterioration in the reproducibility of small-level signals caused bythe target distortion amount and the deterioration in color boundaryinformation caused by the subsampling rate can be appropriatelybalanced. In this case, the reproducibility of small-level signals canbe increased without any great increase in the amount of compressioncode, by sacrificing color boundary information. Alternatively, bysacrificing the reproducibility of small-level signals, it is possibleto improve the reproducibility of color boundaries without anysignificant increase in the amount of compression code.

According to the seventh aspect of the present invention, thesubsampling rate of the chrominance signals is adjusted on the basis ofat least one of the characterizing features of the image, the targetcompression rate, and the target distortion amount. By means of suchalteration of the subsampling rate of the chrominance signals, it ispossible to adjust the distribution of the amount of information of theluminance signal/chrominance signals in the compressed file inaccordance with the image data As a result, the compressed image qualitycan be improved by a distribution of information that is suited to theimage data.

According to the ninth aspect of the present invention, the subsamplingrate of the chrominance signals is set for individual tile images.Accordingly, the subsampling rate of the chrominance signals can befinely adjusted for the respective tile images, so that the compressedimage quality can be further improved.

Moreover, in the image compression apparatuses of the first to fourthaspects, the subsampling rate of the chrominance signals is varied intile image units in accordance with local characterizing features of theimage. Accordingly, operations such as appropriately varying thesubsampling rate of the chrominance signals in areas of rich colorvariation and areas of little color variation within the image can beperformed, so that the compressed image quality can be further improved.

By executing the image compression program of the tenth aspect of thepresent invention with a computer, it is possible to realize theconstituent elements of any one of the first to ninth aspects of thepresent invention in such a computer functioning a virtual machine. As aresult, the image compression apparatus of any one of the first to ninthaspects of the present invention can be realized in a computer.

It will be apparent to those skilled in the art that variousmodifications and variations can be made in the image compressionapparatus and program of the present invention without departing fromthe spirit or scope of the invention. Thus, it is intended that thepresent invention cover the modifications and variations of thisinvention provided they come within the scope of the appended claims andtheir equivalents.

1. An image compression apparatus for compressing image data that has aluminance signal and chrominance signals, comprising: an image judgementpart that judges a proportion of information quantity in the image datathat is part of the chrominance signals on the basis of both theluminance signal and the chrominance signals; a subsampling rate settingpart that sets a subsampling rate of the chrominance signals inaccordance with the proportion; a subsampling processing part thatperforms subsampling processing for the chrominance signals in the imagedata at the subsampling rate; a compression encoding part which subjectsthe subsampling-processed image data to compression encoding; andwherein the subsampling setting part sets the subsampling rate of thechrominance signals at a coarse value when it is judged by the imagejudgement part that the proportion is small and sets the subsamplingrate of the chrominance signals at a fine value when it is judged by theimage judgement part that the proportion is large.
 2. The imagecompression apparatus according to claim 1, wherein the subsampling ratesetting part sets a common subsampling rate over the entire image of thechrominance signals in the image.
 3. The image compression apparatusaccording to claim 1, wherein the subsampling rate setting part sets thesubsampling rate of the chrominance signals in accordance with theproportion and the target compression rate.
 4. An image compressionapparatus for compressing image data that has a luminance signal andchrominance signals, comprising: a compression rate setting part thatsets a target compression rate of the image data; a subsampling ratesetting part that sets a common subsampling rate over an entire image ofthe chrominance signals in accordance with the target compression rate;a subsampling processing part that performs subsampling processing onlyfor the chrominance signals in the image data at the subsampling rate; acompression encoding part that subjects the subsampling-processed imagedata to compression encoding in accordance with the target compressionrate; and wherein the subsampling setting part sets the subsampling rateof the chrominance signals at a coarse value when the target compressionrate is high and sets the subsampling rate of the chrominance signals ata fine value when the target compression rate is low.
 5. The imagecompression apparatus according to claim 1, wherein the compressionencoding performed by the compression encoding part is compressionencoding that is performed in units of tile images obtained by splittingthe image data in the image space; wherein the subsampling rate settingpart sets the subsampling rate separately for each of the tile images,and wherein the subsampling processing part subsamples chrominancesignals in the tile images at the subsampling rate set for each of thetile images.
 6. An article of manufacture comprising: a recording mediumconfigured to be readable by a computer; software codes stored in therecording medium that can be read and interpreted by the computer so asto cause the computer to function as the image compression apparatus ofclaim
 1. 7. An article of manufacture comprising: a recording mediumconfigured to be readable by a computer; software codes stored in therecording medium that can be read and interpreted by the computer so asto cause the computer to function as the image compression apparatus ofclaim
 4. 8. A method for compressing image data that has a luminancesignal and chrominance signals, comprising: judging a proportion ofinformation quantity in the image data that is part of the chrominancesignals, on the basis of both the luminance signal and the chrominancesignals; setting a subsampling rate of the chrominance signals inaccordance with the proportion; performing subsampling processing forthe chrominance signals in the image data at the subsampling rate;subjecting the subsampling-processed image data to compression encoding;and setting the subsampling rate of the chrominance signals at a coarsevalue when it is judged by the image judgement part that the proportionis small and setting the subsampling rate of the chrominance signals ata fine value when it is judged by the image judgement part that theproportion is large.
 9. A method for compressing image data that has aluminance signal and chrominance signals, comprising: setting a targetcompression rate of the image data; setting a common subsampling rateover an entire image of the chrominance signals in accordance with thetarget compression rate; performing subsampling processing only for thechrominance signals in the image data at the subsampling rate;subjecting the subsampling-processed image data to compression encodingin accordance with the target compression rate; and setting thesubsampling rate of the chrominance signals at a coarse value when thetarget compression rate is high, and setting the subsampling rate of thechrominance signals at a fine value when the target compression rate islow.